import React from 'react';
import { View } from '@tarojs/components'
import { getHeadTop } from '../../../utils/tools'

const StatusBar: React.FC<{bg?: string}> = (props) => {
    const headTop = getHeadTop()
    return <View style={`height:${headTop && headTop.statusBar}px;position: fixed;left: 0;top: 0;background-color: ${props.bg};z-index: 999999;width: 100%;`} />
}

StatusBar.defaultProps = {
    bg: 'rgba(0,0,0,0.2)'
}

export default StatusBar
